package com.springcolud.alibaba.hystrix.controller;

import com.springcolud.alibaba.hystrix.service.HystrixPaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:RenPu
 * @Date: 2020/6/30 18:07
 * @Version: 1.0
 * @description:
 */

@RestController
@Slf4j
public class HystrixPaymentController {

    @Resource
    private HystrixPaymentService hystrixPaymentService;


    @GetMapping(value ="/hystrix/test_OK/{id}" )
    public String hystrixTest_OK(@PathVariable Long id){
     return     hystrixPaymentService.test_OK(id);
    }


    @GetMapping(value ="/hystrix/test_ERROR/{id}" )
    public String hystrixTest_ERROR(@PathVariable Long id){
        return     hystrixPaymentService.test_ERROR(id);
    }


}
